import React from 'react'
import { useState } from 'react'
import { connect } from 'react-redux'
function Cart(props) {
    let {num,dispatch} = props
    return (
      <div>
           <div>Cart---{num}</div>
           <button onClick={()=>{
                dispatch({
                    type:"REDUCE",
                    num:10
                })
           }}>--</button>
      </div>
    )
  }
export default connect((state)=>{
    return state
})(Cart)
